import { User } from './models/user.model';
/*
 * @Author: your name
 * @Date: 2021-03-18 21:05:15
 * @LastEditTime: 2021-03-18 21:24:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \tofolls\topfullstack\server\libs\db\src\db.module.ts
 */
import { Global, Module } from '@nestjs/common';
import { DbService } from './db.service';
import { TypegooseModule } from 'nestjs-typegoose'
const models = TypegooseModule.forFeature([User])
@Global()
@Module({
  imports:[
    TypegooseModule.forRoot('mongodb://localhost/topfullstackmy',{
      useNewUrlParser:true,
      useUnifiedTopology:true,
      useCreateIndex:true,
      useFindAndModify:false
    }),
    models,
  ],
  providers: [DbService],
  exports: [DbService,models],
})
export class DbModule {}
